package com.ghsc.ghxc.jsb.ui.live.activity

import androidx.lifecycle.MutableLiveData
import com.cn.appcore.base.BaseViewModel
import com.cn.appcore.ext.executeResponse
import com.cn.appcore.http.bean.BaseResponse
import com.ghsc.ghxc.jsb.api.ApiMarket
import com.ghsc.ghxc.jsb.ui.live.bean.LiveEndResult
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

/**
 * 项目：GuoHuaJsb
 * 包名：com.ghsc.ghxc.jsb.ui.live.activity
 * 类名：LiveEndStopViewModel
 * 创建时间：2024/5/11 13:02
 * 创建人 @author： xiaolin
 * 描述 ：Todo...
 */
class LiveEndStopViewModel : BaseViewModel() {



    /**
     *  直播_获取直播间的打赏礼物信息
     */
    var onLiveEndData = MutableLiveData<BaseResponse<LiveEndResult>>()
    fun onLiveEndMethod(paras:String) {
        launch {
            val response = withContext(Dispatchers.IO) { ApiMarket.service.onLiveEndData(paras) }
            executeResponse(
                response,
                { onLiveEndData.value = response },
                { againLoginMsg.value = response.msg }
            ) { errorMsg.value = response.msg }
        }
    }
}